# Maintainer: Renato Silva <br.renatosilva@gmail.com>

_realname='vimpager'
pkgname="${_realname}-git"
pkgdesc='Use ViM as PAGER'
url='http://www.vim.org/scripts/script.php?script_id=1723'
license=(BSD)
arch=(any)
pkgver=r652.0730cb3
pkgrel=1

makedepends=(git)
depends=(vim sharutils)
provides=(${_realname})
conflicts=(${_realname})
source=('git+https://github.com/rkitover/vimpager')
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/${_realname}"
  printf "r%s.%s" $(git rev-list --count HEAD) $(git rev-parse --short HEAD)
}

build() {
  cd "${srcdir}/${_realname}"
  make vimpager
}

package() {
  cd "${srcdir}/${_realname}"
  make DESTDIR="${pkgdir}" SYSCONFDIR='/etc' PREFIX='/usr' install
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${_realname}/LICENSE"
}
